import Http from './Http'
class HomeHttp extends Http {
    static getMovie(url) {
        return this.request({
            url: `api/movie/${url}`
        })
    }
    // static getHotMovie() {
    //     return this.request({
    //         url: "api/movie/inTheaters"
    //     })
    // }
    // static getComingMovie() {
    //     return this.request({
    //         url: "api/movie/comingSoon"
    //     })
    // }
    static handleStar(num) {
        var arr = []
        for (var i = 0; i < 5; i++) {
            if (num >= 2) {
                arr.push(num)
            } else if (num > 0) {
                arr.push(Number(num).toFixed(2))
            } else {
                arr.push(0)
            }
            num-=2
        }
        return arr;
    }
}
export default HomeHttp;